package com.xiaoxing.salesclient.mvp.model.service;

import com.xiaoxing.salesclient.mvp.model.entity.Accept;
import com.xiaoxing.salesclient.mvp.model.entity.AddProccess;
import com.xiaoxing.salesclient.mvp.model.entity.AppointCheck;
import com.xiaoxing.salesclient.mvp.model.entity.AppointDetail;
import com.xiaoxing.salesclient.mvp.model.entity.AppointDoctor;
import com.xiaoxing.salesclient.mvp.model.entity.AppointSet;
import com.xiaoxing.salesclient.mvp.model.entity.AppointTime;
import com.xiaoxing.salesclient.mvp.model.entity.Article;
import com.xiaoxing.salesclient.mvp.model.entity.AuctionBid;
import com.xiaoxing.salesclient.mvp.model.entity.AuctionBuy;
import com.xiaoxing.salesclient.mvp.model.entity.AuctionDetail;
import com.xiaoxing.salesclient.mvp.model.entity.AuctionList;
import com.xiaoxing.salesclient.mvp.model.entity.AuctionSearch;
import com.xiaoxing.salesclient.mvp.model.entity.Category;
import com.xiaoxing.salesclient.mvp.model.entity.Complete;
import com.xiaoxing.salesclient.mvp.model.entity.GoodsReport;
import com.xiaoxing.salesclient.mvp.model.entity.GoodsReportSubmit;
import com.xiaoxing.salesclient.mvp.model.entity.Index;
import com.xiaoxing.salesclient.mvp.model.entity.OrderBuy;
import com.xiaoxing.salesclient.mvp.model.entity.OrderExchange;
import com.xiaoxing.salesclient.mvp.model.entity.OrderPay;
import com.xiaoxing.salesclient.mvp.model.entity.ProcessDetail;
import com.xiaoxing.salesclient.mvp.model.entity.ProcessList;
import com.xiaoxing.salesclient.mvp.model.entity.ProductCateList;
import com.xiaoxing.salesclient.mvp.model.entity.ProductDetail;
import com.xiaoxing.salesclient.mvp.model.entity.ProductList;
import com.xiaoxing.salesclient.mvp.model.entity.ProductOrder;
import com.xiaoxing.salesclient.mvp.model.entity.SendCode;
import com.xiaoxing.salesclient.mvp.model.entity.Specialcat;
import com.xiaoxing.salesclient.mvp.model.entity.SpecialcatDetail;
import com.xiaoxing.salesclient.mvp.model.entity.Staffs;
import com.xiaoxing.salesclient.mvp.model.entity.StoreShop;
import com.xiaoxing.salesclient.mvp.model.entity.Transfer;
import com.xiaoxing.salesclient.mvp.model.entity.TransferXuanZe;
import com.xiaoxing.salesclient.mvp.model.entity.Transfered;
import com.xiaoxing.salesclient.mvp.model.entity.UpdateOrder;
import com.xiaoxing.salesclient.mvp.model.entity.UpdatePassword;
import com.xiaoxing.salesclient.mvp.model.entity.UpdateUserInfo;
import com.xiaoxing.salesclient.mvp.model.entity.UploadMemberImage;
import com.xiaoxing.salesclient.mvp.model.entity.UserCenter;
import com.xiaoxing.salesclient.mvp.model.entity.UserStaffCenter;
import com.xiaoxing.salesclient.mvp.model.entity.WoDeGuanZhu;

import io.reactivex.Observable;
import me.jessyan.armscomponent.commonres.utils.AppUpdate;
import me.jessyan.armscomponent.commonres.utils.CouponsReceive;
import me.jessyan.armscomponent.commonres.utils.MyCouponsList;
import me.jessyan.armscomponent.commonres.utils.MySgninCouponsList;
import me.jessyan.armscomponent.commonres.utils.TodayIsSign;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * @author 小星 QQ:753940262
 * @class describe
 * @time 2018/7/9 0009 14:11
 */
public interface SalesService {

    /**
     * 获取首页数据
     */
//    @GET("http://47.100.103.123/api.php?app_key=woaixuxiaoxing&method=dsc.user.login.get&user_name=fan&password=123456")
    @GET("/api/index.php")
    Observable<Index> getIndex();

    /**
     * 获取头条文章的数据
     *
     * @param article_id
     * @return
     */
    @GET("/api/article.php")
    Observable<Article> getArticle(@Query("article_id") String article_id);

    /**
     * 获得店铺列表-（展位推广更多）
     *
     * @param access_token
     * @param sort         排行：goods_number 最旺：sales_volume 最新：不传参数 传DESC
     * @param order        ASC升序 DESC降序
     * @param cat_left_id  二级分类
     * @return
     */
    @GET("/api/store_shop_list.php")
    Observable<StoreShop> getStoreShop(
            @Query("access_token") String access_token,
            @Query("sort") String sort,
            @Query("order") String order,
            @Query("cat_left_id") String cat_left_id
    );

    /**
     * 个人中心-我的关注列表
     *
     * @param access_token
     * @return
     */
    @GET("/api/auction_bid.php")
    Observable<AuctionBid> getAuctionBid(
            @Query("access_token") String access_token
    );

    /**
     * 拍品搜索
     *
     * @param keywords 商品名或者拍品名字
     * @return
     */
    @GET("/api/auction_list.php")
    Observable<AuctionList> getAuctionList(
            @Query("keywords") String keywords
    );

    /**
     * 拍品列表（微拍推广更多）
     *
     * @param access_token
     * @param sort         综合：end_time 价格：current_price 最新：act_id
     * @param order        ASC升序 DESC降序
     * @param cat_left_id  二级分类
     * @return
     */
    @GET("/api/auction_list.php")
    Observable<AuctionList> getAuctionList(
            @Query("access_token") String access_token,
            @Query("sort") String sort,
            @Query("order") String order,
            @Query("cat_left_id") String cat_left_id
    );

    /**
     * 个人中心-我的关注列表
     *
     * @param access_token
     * @return
     */
    @GET("/api/my_collection_store_list.php")
    Observable<WoDeGuanZhu> getMyCollectionStoreList(
            @Query("access_token") String access_token
    );

    /**
     * 分类接口
     *
     * @return
     */
    @GET("/api/category_index.php")
    Observable<Category> category(
    );

    /**
     * 专场列表
     *
     * @return
     */

    @GET("/api/specialcat.php")
    Observable<Specialcat> specialcat(
    );

    @GET("/api/specialcat.php")
    Observable<SpecialcatDetail> getSpecialcatDetail(
            @Query("specialcat_id") String specialcat_id
    );

    @GET("/api/auction_search.php")
    Observable<AuctionSearch> getAuctionSearch(
            @Query("keywords") String keywords
    );

    @GET("/api/update.php")
    Observable<AppUpdate> checkAppUpdate(
    );

    /**
     * 今天是否签到
     *
     * @param access_token
     * @return
     */
    @GET("/api/today_is_sign.php")
    Observable<TodayIsSign> todayIsSign(
            @Query("access_token") String access_token
    );

    /**
     * 获取签到历史信息
     *
     * @param access_token
     * @param year_month
     * @return
     */
    @GET("/api/my_signin_coupons_list.php")
    Observable<MySgninCouponsList> mySgninCouponsList(
            @Query("access_token") String access_token,
            @Query("year_month") String year_month
    );

    /**
     * 签到
     *
     * @param access_token
     * @param cou_id
     * @return
     */
    @GET("/api/coupons_receive.php")
    Observable<CouponsReceive> couponsReceive(
            @Query("access_token") String access_token,
            @Query("cou_id") String cou_id
    );

    @GET("/api/my_coupons_list.php")
    Observable<MyCouponsList> myCouponsList(
            @Query("access_token") String access_token
    );

    /**
     * 获得拍品详细信息
     *
     * @param act_id
     * @return
     */
    @GET("/api/auction.php")
    Observable<AuctionDetail> auctionDetail(
            @Query("act_id") String act_id
    );

    /**
     * 举报
     *
     * @param access_token
     * @param goods_id
     * @return
     */
    @GET("/api/goods_report.php")
    Observable<GoodsReport> goodsReport(
            @Query("access_token") String access_token,
            @Query("goods_id") String goods_id
    );

    /**
     * 提交举报
     *
     * @param access_token
     * @param goods_id
     * @param goods_name
     * @param goods_image
     * @param title_id
     * @param type_id
     * @param inform_content
     * @return
     */
    @GET("/api/goods_report_submit.php")
    Observable<GoodsReportSubmit> goodsReportSubmit(
            @Query("access_token") String access_token,
            @Query("goods_id") String goods_id,
            @Query("goods_name") String goods_name,
            @Query("goods_image") String goods_image,
            @Query("title_id") String title_id,
            @Query("type_id") String type_id,
            @Query("inform_content") String inform_content
    );

    /**
     * 出价
     *
     * @param access_token
     * @param auction_id
     * @param bid_price
     * @return
     */
    @GET("/api/auction_bid.php")
    Observable<AuctionBid> auctionBid(
            @Query("access_token") String access_token,
            @Query("auction_id") String auction_id,
            @Query("bid_price") String bid_price
    );

    /**
     * 立即购买接口
     *
     * @param access_token
     * @param auction_id
     * @return
     */
    @GET("/api/auction_buy.php")
    Observable<AuctionBuy> auctionBuy(
            @Query("access_token") String access_token,
            @Query("auction_id") String auction_id
    );

    /**
     * 客户端个人中心
     *
     * @param access_token
     * @return
     */
    @GET("/api/user/center")
    Observable<UserCenter> userCenter(
            @Query("access_token") String access_token
    );

    @GET("/api/user/userInfo")
    Observable<UserCenter> userInfo(
            @Query("access_token") String access_token,
            @Query("uid") String uid
    );

    /**
     * 订购单-客户端
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/productOrder")
    Observable<ProductOrder> productOrder(
            @Query("access_token") String access_token
    );


    /**
     * 订购单-员工
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/productOrderAll")
    Observable<ProductOrder> productOrderAll(
            @Query("access_token") String access_token
    );


    /**
     * 疗程订单-客户端
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/courseOrder")
    Observable<ProductOrder> courseOrder(
            @Query("access_token") String access_token
    );

    /**
     * 疗程订单-员工
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/courseOrderAll")
    Observable<ProductOrder> courseOrderAll(
            @Query("access_token") String access_token
    );

    /**
     * 产品价格 分类接口
     *
     * @return
     */
    @GET("/api/product/cateList")
    Observable<ProductCateList> productCateList(
    );

    /**
     * 产品列表接口
     *
     * @param type_id
     * @return
     */
    @GET("/api/product/productList")
    Observable<ProductList> productList(
            @Query("type_id") String type_id,
            @Query("shop_id") String shop_id
    );

    /**
     * 疗程价目列表
     *
     * @param type_id
     * @param shop_id
     * @return
     */
    @GET("/api/product/medproList")
    Observable<ProductList> medproList(
            @Query("type_id") String type_id,
            @Query("shop_id") String shop_id);

    /**
     * 积分商品
     *
     * @param type_id
     * @return
     */
    @GET("/api/product/pointproduct")
    Observable<ProductList> pointproduct(
            @Query("type_id") String type_id
    );

    /**
     * 醫師列表
     *
     * @param date         格式为：2018-08-22
     * @param access_token
     * @param shop_id
     * @return
     */
    @GET("/api/appoint/doctor")
    Observable<AppointDoctor> appointDoctor(
            @Query("date") String date,
            @Query("access_token") String access_token,
            @Query("shop_id") String shop_id
    );

    /**
     * 预约时间查询
     *
     * @return
     */
    @GET("/api/appoint/appointTime")
    Observable<AppointTime> appointTime(
    );

    /**
     * 预约查询接口
     *
     * @param date
     * @param time_id
     * @param access_token
     * @param shop_id
     * @return
     */
    @GET("/api/appoint/check")
    Observable<AppointCheck> appointCheck(
            @Query("date") String date,
            @Query("time_id") String time_id,
            @Query("access_token") String access_token,
            @Query("shop_id") String shop_id
    );

    /**
     * @param date
     * @param time_id
     * @param access_token
     * @param doctor_id
     * @return
     */
    @GET("/api/appoint/set")
    Observable<AppointSet> appointSet(
            @Query("date") String date,
            @Query("time_id") String time_id,
            @Query("access_token") String access_token,
            @Query("doctor_id") String doctor_id,
            @Query("uid") String uid
    );

    /**
     * 医师详情
     *
     * @param access_token
     * @param doctor_id
     * @return
     */
    @GET("/api/appoint/detail")
    Observable<AppointDetail> appointDetail(
            @Query("access_token") String access_token,
            @Query("doctor_id") String doctor_id
    );

    /**
     * 兑换接口
     *
     * @param product_id
     * @param access_token
     * @return
     */
    @GET("/api/order/exchange")
    Observable<OrderExchange> orderExchange(
            @Query("product_id") String product_id,
            @Query("access_token") String access_token
    );

    /**
     * 产品详情页接口
     *
     * @param product_id
     * @return
     */
    @GET("/api/product/detail")
    Observable<ProductDetail> productDetail(
            @Query("product_id") String product_id
    );

    /**
     * 产品订购接口
     *
     * @param product_id
     * @param access_token
     * @return
     */
    @GET("/api/order/buy")
    Observable<OrderBuy> orderBuy(
            @Query("product_id") String product_id,
            @Query("access_token") String access_token,
            @Query("product_num") String product_num
    );

    @GET("/api/order/buy")
    Observable<OrderBuy> orderBuy(
            @Query("product_id") String product_id,
            @Query("access_token") String access_token,
            @Query("product_num") String product_num,
            @Query("is_staff") String is_staff
    );


    /**
     * SOP流程-加入流程接口
     * processdetail
     *
     * @param appoint_id
     * @param mobile
     * @param access_token
     * @return
     */
    @GET("/api/order/addprocess")
    Observable<AddProccess> addproccess(
            @Query("appoint_id") String appoint_id,
            @Query("mobile") String mobile,
            @Query("access_token") String access_token
    );

    /**
     * SOP流程-流程列表
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/processlist")
    Observable<ProcessList> processlist(
            @Query("access_token") String access_token
    );

    /**
     * SOP流程-流程详情
     *
     * @param access_token
     * @param order_id
     * @return
     */
    @GET("/api/order/processdetail")
    Observable<ProcessDetail> processdetail(
            @Query("access_token") String access_token,
            @Query("order_id") String order_id
    );

    /**
     * SOP流程-流程详情-点击接口
     *
     * @param access_token
     * @param order_id
     * @param cate_id
     * @return
     */
    @GET("/api/order/updateorder")
    Observable<UpdateOrder> updateorder(
            @Query("access_token") String access_token,
            @Query("order_id") String order_id,
            @Query("cate_id") String cate_id
    );

    /**
     * 服务人员接口
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/staffs")
    Observable<Staffs> staffs(
            @Query("access_token") String access_token
    );

    /**
     * 转接接口
     *
     * @param access_token
     * @param order_id
     * @param staff_id
     * @return
     */
    @GET("/api/order/transfer")
    Observable<TransferXuanZe> transfer(
            @Query("access_token") String access_token,
            @Query("order_id") String order_id,
            @Query("staff_id") String staff_id
    );

    /**
     * 监听是否有转接
     *
     * @param access_token
     * @return
     */
    @GET("/api/order/transfered")
    Observable<Transfered> transfered(
            @Query("access_token") String access_token
    );

    /**
     * 接收转接接口
     *
     * @param access_token
     * @param order_id
     * @param transfer_id
     * @return
     */
    @GET("/api/order/accept")
    Observable<Accept> accept(
            @Query("access_token") String access_token,
            @Query("order_id") String order_id,
            @Query("transfer_id") String transfer_id
    );

    /**
     * 确认流程完成接口
     *
     * @param access_token
     * @param order_id
     * @return
     */
    @GET("/api/order/complete")
    Observable<Complete> complete(
            @Query("access_token") String access_token,
            @Query("order_id") String order_id
    );

    @Multipart
    @POST("/api/user/uploadMemberImage")
    Observable<UploadMemberImage> uploadMemberImage(
            @Part("access_token") RequestBody access_token,
            @Part MultipartBody.Part cover
    );

    @GET("/api/user/updateUserInfo")
    Observable<UpdateUserInfo> updateUserInfo(
            @Query("access_token") String access_token,
            @Query("nick_name") String nick_name,
            @Query("address") String address,
            @Query("password") String password,
            @Query("email") String email,
            @Query("mobile") String mobile
    );

    @GET("/api/user/sendCode")
    Observable<SendCode> sendCode(
            @Query("user_name") String user_name
    );

    @POST("/api/user/updatePassword")
    Observable<UpdatePassword> updatePassword(
            @Query("user_name") String user_name,
            @Query("code") String code,
            @Query("password") String password
    );

    @GET("/api/appoint/checkDetail")
    Observable<AppointTime> checkDetail(
            @Query("access_token") String access_token,
            @Query("doctor_id") String doctor_id,
            @Query("date") String date,
            @Query("shop_id") String shop_id
    );

    @GET("/api/order/pay")
    Observable<OrderPay> orderPay(
            @Query("access_token") String access_token,
            @Query("order_no") String order_no
    );

    @GET("/api/order/pay")
    Observable<OrderPay> orderPay(
            @Query("access_token") String access_token,
            @Query("order_no") String order_no,
            @Query("is_staff") String is_staff
    );

    @GET("/api/user/staffCenter")
    Observable<UserStaffCenter> userStaffCenter(
            @Query("access_token") String access_token
    );


}
